﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentScheduler;
using System.Threading.Tasks;
using YiYiTong.Rocket.Helper;
using YiYiTong.Rocket.Business;

namespace YiYiTong.Rocket.ProcessConsole
{
    /// <summary>
    /// 按日期结算销售费用
    /// </summary>
    public class SaleSettlementJob : BaseJob
    {
        public override void DoAction()
        {

            //今天结算的是昨天的数据
            var result = OrderBiz.Instance.SaleSettlement(DateTime.Now.AddDays(-1));
            if (!result.Item1)
                LogHelper.Error("结算销售费用错误，原因：" + result.Item2);

            //维护数据
            OrderBiz.Instance.SaleSettlementRepair();
        }
    }
}
